<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>散客消费</title>
<meta name="decorator" content="default" />
<style type="text/css">
fieldset {
	display: inline-block;
	width: 100%;
}

.container {
	width: 80%;
	margin: auto;
}
</style>

</head>
<body>
	<div class="container">
		<div class="icon-buttons">
			<a data-role="button" data-inline="true" data-icon="back"
				data-iconpos="notext" href="${ctx}">返回</a>
		</div>
		<input type="button"
			onclick="directOpenURL('${ctx}/cash/consume/cashNonmemberForm')"
			data-inline="true" value="散客消费" />
		<form:form id="searchForm" modelAttribute="history"
			action="${ctx}/cash/consume/historyNonmembers" method="post">
			<input id="pageNo" name="pageNo" type="hidden" value="${history.page.pageNo}" />
			<input id="pageSize" name="pageSize" type="hidden"
				value="${history.page.pageSize}" />
			<label>开始日期：</label>
			<input type="date" id="startDate" data-inline="true" name="startDate"
				value="" />
			<label>结束日期：</label>
			<input type="date" id="endDate" data-inline="true" name="endDate"
				value="" />

			<input id="btnSubmit" type="submit" data-inline="true" value="查询消费记录"
				data-inline="true" />
		</form:form>



		<tags:message content="${message}" />
		<table id="contentTable" data-role="table"
			class="ui-responsive table-stroke">
			<thead>
				<tr>
					<th>消费日期</th>
					<th>消费项目</th>
					<th>消费金额</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${history.page.list}" var="consume">
					<tr id="${consume.storeConsume.id}">
						<td>${fns:formatDate(consume.storeConsume.consume_Time,'yyyy-MM-dd
							HH:mm:ss')}</td>
						<td>${consume.description}</td>
						<td>${consume.storeConsume.money_To_Pay}</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div class="pagination">${history.page}</div>
	</div>
	<script type="text/javascript">
		function registerSelection() {// registerSelectionListener
			$("#contentTable tbody")
					.delegate(
							"tr",
							"click",
							function() {
								$("#contentTable tbody tr").removeClass(
										"select_active");
								$(this).addClass("select_active");
								var url = "${ctx}/cash/consume/consumeDetailPage?consumeID="
									+ $(this).attr("id");
								setTimeout(function(){
									directOpenURL(url);
								},500);
								
							});
		}
		$().ready(function() {
			registerSelection();
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</body>
</html>
